/**
 * Project: d20Engine
 * Created: Oct 21, 2006 by bebopJMM
 */
package org.rollinitiative.d20.entity;

import org.rollinitiative.d20.Adjustment;
import org.rollinitiative.d20.Adjustment.AdjustmentSource;

import javax.xml.bind.annotation.*;
import javax.xml.namespace.QName;
/**
 * Enumeration of the sizes that an entity may be classified as. The modifiers comply to the D20
 * SRD.
 * 
 * @see http://www.d20srd.org/srd/combat/combatStatistics.htm
 * 
 * @author bebopjmm
 */
@XmlType (name = "SizeEnum", namespace = "java:org.rollinitiative.d20.entity")
public enum Size {
   FINE(8, -16), DIMINUTIVE(4, -8), TINY(2, -4), SMALL(1, -2), MEDIUM(0, 0), LARGE_TALL(-1, 2), LARGE_LONG(
         -1, 2), HUGE_TALL(-2, 4), HUGE_LONG(-2, 4), GARGANTUAN_TALL(-4, 8), GARGANTUAN_LONG(-4, 8), COLOSSAL_TALL(
         -8, 16), COLOSSAL_LONG(-8, 16);

   private final int combatMod;

   private final int grappleMod;


   Size(int combatModifier, int grappleModifier)
   {
      combatMod = combatModifier;
      grappleMod = grappleModifier;
   }


   public int getCombatModifier()
   {
      return combatMod;
   }


   public int getGrappleModifier()
   {
      return grappleMod;
   }


   public static Adjustment generateCombatAdjustment(Size size)
   {
      return new Adjustment(AdjustmentSource.INHERENT, size.combatMod, new QName("java:org.rollinitiative.d20.entity", "size.combat"));
   }


   public static Adjustment generateGrappleAdjustment(Size size)
   {
      return new Adjustment(AdjustmentSource.INHERENT, size.grappleMod, new QName("java:org.rollinitiative.d20.entity", "size.grapple"));
   }

}
